package com.mpyy.pojo;

import lombok.*;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @version 1.0 商品退货查询下部分表格
 * @Descrioption SaleOrderDescAndSaleReturn
 * @Author QIAO
 * @Date 2022-03-12 14:36
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class SaleOrderDescAndSaleReturn {
    private String orproId;

    private String orproName;

    private String orsalOrdDescUnit;

    private Date orsalOrdDescProValidityDate;

    private Double orsalOrdDescProPrice;

    private Integer orsalOrdDescProNum;

    private String orsalOrdDescProBatchNum;

    private String orproSize;

    private String orsalOrdId;

    private String orsalOrdDescComment;

    //分页参数
    private Integer page;

    private Integer limit;

    public void setPage(Integer page){
        this.page = ( page - 1 ) * this.limit;
    }

    //搜索，开始日期
    private Date currentTimeStart;
    //搜索，结束日期
    private Date currentTimeEnd;

    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");

    public void setCurrentTimeStart(String currentTimeStart){
        try {
            this.currentTimeStart = simpleDateFormat.parse(currentTimeStart);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

    public void setCurrentTimeEnd(String currentTimeEnd){
        try {
            this.currentTimeEnd = simpleDateFormat.parse(currentTimeEnd);
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }

}
